import { getMedicalOrderDetailAPI } from '@/api/order'
import type { MedicalOrderDetail } from '@/type/order'
import { ref } from 'vue'

export const useMedicalOrder = (orderId: string) => {
  // 获取地址的参数

  // 1. 药品订单详情
  const orderDetail = ref({} as MedicalOrderDetail)

  // 查询订单详情
  async function getOrderDetail() {
    // 订单详情接口
    const data = await getMedicalOrderDetailAPI(orderId)
    // 渲染订单数据
    orderDetail.value = data
  }

  // 查询药品订单详情
  getOrderDetail()
  return {
    orderDetail,
  }
}
